import React, { Component } from 'react';
import { Swiper } from 'antd-mobile'
import "../../styles/Details/DetailsSwiper.scss"

class DetailsSwiper extends Component {
    constructor(props) {
        super(props);
        this.state = {
            swiperlist: []
        }
    }
    render() {
        return (
            <div className='DetailsSwiper'>
                <Swiper loop autoplay autoplayInterval={1000}>
                    {
                        this.props.swiperlist &&
                        this.props.swiperlist.length &&
                        this.props.swiperlist.map((item, index) => {
                            return (
                                <Swiper.Item key={index}>
                                    <img src={item.pic} alt="" />
                                </Swiper.Item>
                            )
                        })
                    }
                </Swiper>
            </div>
        );
    }
}

//类型验证
// DetailsSwiper.propTypes = {
//     swiperlist:{ type: PropTypes.array, default:[] }
// }

export default DetailsSwiper;